package collection;

import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Random;

/**
 * @author DBX
 * @effect  生成10个0-100之间的不重复的随机数,并输出
 * @date 2021/09/04/16:20
 */
public class Test3 {
    public static void main(String[] args) {
        Random random = new Random();
        Collection c = new HashSet();
        boolean state = true;
        while (state){
            c.add(random.nextInt(100));
            if (c.size()==10){
                state = false;
            }
        }
        System.out.println(c);
    }
}
